//
//  ViewController.m
//  IOS-核心动画_01图层的树状结构
//
//  Created by apple on 16/5/26.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIView *backView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    //Layer层 与 UIView 为平行的层级关系 .
    //Layer层 不用用户交互(没有响应者链概念)
    //视图层 , 图层树 , 呈现树 , 渲染树
    
    //用Layer层添加子视图
    [self addchildViewFromLayer];
    
    
    
    
}


//用Layer层添加子视图
- (void)addchildViewFromLayer{

    CALayer *bluelayer = [CALayer layer];
    bluelayer.frame = CGRectMake(50, 50, 100, 100);
    
    bluelayer.backgroundColor = [UIColor blueColor].CGColor;
    
    [self.backView.layer addSublayer:bluelayer];

}



@end
